/**
 * Created by mapbar_front on 2019/8/6.
 */
import React,{Component} from 'react';

class FancyButton extends Component{
    constructor(props){
        super(props);
        this.ref = React.createRef();
    }
    handleClick=(ref)=>{
        ref.current.focus();
    }
    render(){
        return(
            <div>
                <input ref={this.ref}/>
                <button onClick={()=>this.handleClick(this.ref)}>
                    点击
                </button>
            </div>
        )
    }
}

class Refs13 extends Component{
    render(){
        return(
            <div>
                <FancyButton/>
            </div>
        )
    }
}
export default Refs13;
